package buildings.threads;

import buildings.Floor;

public class SequentalCleaner implements Runnable {

    Semaphore s;

    public SequentalCleaner(Semaphore s) {
        this.s = s;
    }

    @Override
    public void run() {
        for (int i = 0; i < s.getFloor().getSpaceCount(); i++) {
            try {
                s.clean(i);
            } catch(InterruptedException e) {
                Thread.currentThread().interrupt();
            }
        }
    }
}
